package com.example.mytayunapi.Mapper;

import com.example.mytayunapi.Entity.product_listInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface product_listInfoMapper {

    @Update("update product_list set category=#{category}, subcategory=#{subcategory} where id=#{id}")
    Integer updateProductList(product_listInfo product_listinfo);

    @Delete("delete from product_list where id=#{id}")
    Integer deleteProductList(Integer id);

    @Select("SELECT * FROM product_list")
    List<product_listInfo> findAll();

    @Insert("insert into product_list(category,subcategory) values(#{category},#{subcategory})")
    Integer insertProduct_list(product_listInfo product_listinfo);

    @Select("select * from product_list group by category")
    List<product_listInfo> findAllCategory();

}
